import 'package:get/get.dart';

// 车辆表的键
class DbTableVehicleKeys {
  static const String userId = "user_uid"; // 外键，关联用户uid
  static const String sn = "sn";
  static const String productModel = "product_model"; // 产品模型
  static const String bleName = "ble_name";
  static const String vehicleName = "vehicle_name";
  static const String createdStamp = "created_stamp"; // 创建时间戳
  static const String updatedStamp = "updated_stamp"; // 更新时间戳
  static const String connectStamp = "connect_stamp"; // 连接时间戳
  static const String isSelected = "is_selected"; // 是否选中
  static const String firmwareInfo = "firmware_info"; // 固件信息
  static const String realtimeLocationSwitch =
      "realtime_loc"; // 实时定位开关 0:关闭 1:开启
  static const String isOwner = "is_owner"; // 是否车主
  static const String tboxStatus = "tbox_status"; // TBox状态
  static const String hmicStatus = "hmic_status"; // HMIC状态

  static const List<String> values = [
    userId,
    sn,
    productModel,
    bleName,
    vehicleName,
    createdStamp,
    updatedStamp,
    connectStamp,
    isSelected,
    firmwareInfo,
    realtimeLocationSwitch,
    isOwner,
    tboxStatus,
    hmicStatus,
  ];

  // 通过 title 获取键
  static String? getTypeByTitle(String title) =>
      values.firstWhereOrNull((key) => key == title);
}
